home *** CD-ROM | disk | FTP | other *** search
- /* Memory..start with runelf(SAS C)
- *
- * show how to use the pool system. Basicly it`s only a test if it works:-)
- *
- */
- #include <exec/memory.h>
- #include <powerup/gcclib/powerup_protos.h>
- #include <stdio.h>
- #include <string.h>
-
- #define POOLSIZE 0x20
- #define ALLOCSIZE 0x4
-
- void *AllocArray[(POOLSIZE/ALLOCSIZE)];
-
- int main(void)
- {
- void *MyPool;
- ULONG i;
- void *Mem;
-
- if (MyPool=PPCCreatePool(MEMF_PUBLIC,POOLSIZE,POOLSIZE))
- {
- for (i=0;i<(POOLSIZE/ALLOCSIZE);i++)
- {
- Mem=PPCAllocPooled(MyPool,ALLOCSIZE);
- printf("0x%lx\n",Mem);
- }
-
- PPCDeletePool(MyPool);
- }
- else
- {
- printf("Could not open ppc.library v44+\n");
- }
- }
-
-